<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"
	trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="../admin.inc.jsp"%>
<script>
	function toSubmit() {		
		var obj = $("#upload");
		var form = $("#form_graphicsInfo_edit");
		form.submit();
	}
	function callback(success, msg) {
		if (success) {
			alertMsg.info(msg);
			$.pdialog.closeCurrent();
			// 刷新列表
			var tabId = getCurrentNavtab().attr("tabid");
			if (tabId != null) {
				navTab.reload("", {
					navTabId : ""
				});
			}
		}else{
			alertMsg.error(msg);
		}
	}
	

</script>
<div class="pageContent">
	<s:form name="myForm" id="form_graphicsInfo_edit" action="/admin/graphicsInfo/edit"
		method="POST" enctype="multipart/form-data" target="hidden_frame">
		<div class="pageFormContent" layoutH="58">
			<p>
				<label>姓名：</label>
				<input type="text" name="graphicsInfo.name" value="${graphicsInfo.name }">
			</p>
			
			<p>
				<label>价格：</label>
				<input type="text" name="graphicsInfo.price"  value="${graphicsInfo.price }">
			</p>
			
			<p>
				<label>城市：</label>
				<select id="prinCode"  onchange="princeChange();">
					<c:forEach var="item1" items="${plmProvinceList}">
		            	<option value="${item1.code}">${item1.name}</option>
		            </c:forEach>
					<%-- <c:forEach var="item1" items="${cityList}">
		            	<option value="${item1.code}"  ${graphicsInfo.cityCode==item1.code?"selected":""}>${item1.name}</option>
		            </c:forEach> --%>
				</select>
				<select id="cityCode"  name="graphicsInfo.cityCode" >
				<option value="">-请选择--</option>
					<c:forEach var="item1" items="${cityList}">
		            	<option value="${item1.code}"  ${graphicsInfo.cityCode==item1.code?"selected":""}>${item1.name}</option>
		            </c:forEach> 
				</select>
			</p>
			
			<p>
				<label>联系方式：</label>
				<input type="text" name="graphicsInfo.phoneNo"  value="${graphicsInfo.phoneNo }">
			</p>
			
			<p class="nowrap">
				<label style="width:80px;">&nbsp;</label> 
				 <input type="file" name="image"
					id="image" />
			</p>
			
			<p style='height:60px; '>
				<label style="width:80px;">缩略图：</label> 
				 <img alt="" src="${imageUrl }"  style='height:60px; border: 1px solid silver;'>
			</p>
			
			<p class="nowrap">
				<label>工作履历：</label> 
				<textarea style="height:100px;width:253px;"  name="graphicsInfo.richResume" >${graphicsInfo.richResume }</textarea>
			</p>
			
			<p class="nowrap">
				<label>备注：</label> 
				<textarea style="height:100px;width:253px;"  name="graphicsInfo.remark" >${graphicsInfo.remark }</textarea>
			</p>
			
			<p>
				<label>风格：</label>
			</p>
			
			<p style="margin-left:58px;margin-bottom:18px;">
				<c:forEach var="style" items="${styleList}">
					<label style="text-align:left;"><input type="checkbox" name="style" value="${style.configValue}"  ${ styleMap[style.configValue] !=null?"checked":""}/>${style.description}</label>
				</c:forEach>
			</p>
			
		<input type="hidden" name="graphicsInfo.id" id="type" value="${graphicsInfo.id}" />
		</div>
	</s:form>
	<div class="formBar">
		<ul>
			<li><div class="button">
					<div class="buttonContent">
						<button onclick="toSubmit()" type="button">确定</button>
					</div>
				</div></li>
			<li><div class="button">
					<div class="buttonContent">
						<button type="button" class="close">关闭</button>
					</div>
				</div></li>
		</ul>
	</div>
</div>
<script type="text/javascript">

function princeChange(){
	var prinCode=$("#prinCode").val();
	var citysStr='${cityList}';
	var citys=JSON.parse(citysStr);
	$("#cityCode").html('<option value="">-请选择--</option>');
	for(var i=0;i<citys.length;i++){
		var city=citys[i];
		if(prinCode==city.provinceCode){
			$("#cityCode").append('<option value="'+city.code+'">'+city.name+'</option>');
		}
	}
	
}

</script>
<iframe name='hidden_frame' id="hidden_frame" style='display: none'></iframe>